package com.xy.cloud.config;

import cn.dev33.satoken.stp.StpInterface;
import cn.dev33.satoken.stp.StpUtil;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * 自定义权限验证接口扩展
 */
@Component
public class StpInterfaceImpl implements StpInterface {

    @Override
    public List<String> getPermissionList(Object loginId, String loginType) {
        System.out.println("2222222221111");
        Object loginId1 = StpUtil.getLoginId();
        // 返回此 loginId 拥有的权限列表
        return Stream.of("1").collect(Collectors.toList());
    }

    @Override
    public List<String> getRoleList(Object loginId, String loginType) {
        System.out.println("---------------1111");
        // 返回此 loginId 拥有的角色列表
        return Stream.of("1").collect(Collectors.toList());
    }

}